C (128/301)

From:Fritsch Alexander
Date:23 Aug 99 at 08:20:49
Subject:Drawing in a window

From: Fritsch Alexander <Alexander.Fritsch@icn.siemens.de>

Hello,
today I need your help in another problem:

I program a kind of oscilloscope. So I read audio data and display them in a
window on the workbench.
I opened a window, obtained the pens I wanted to have and now I use Draw()
to paint the output in the
window. That works fine and looks nice. As I draw new data again an again
there is no problem with damaging
the window if I move other windows over my oscilloscope.

But if I were stopping to call Draw() I think my window contents would be
damaged if I move other windows over my
oscilloscope. What is the right way to prevent my window from beeing
damaged? (But I need to be as fast as possible)

I want to have a "Cursor" in my oscilloscope. That means I would like to
have one or two yellow lines on top of my display.
I would like to be able to move these cursors with the mouse. But I dont
want to add standard propotional gadgets to the window,
I want to move the "Cursors" directly with the mouse. What is the right way
here? Should I look after mouse events in the windows
event loop and if there is a "mouse down" then look whether the mouse is
near my cursor? Or is there a better (not so self made) solution?
Does somebody have an example for me? (Open a window and move a line with
the mouse)

Finally I want to make my window somewhat nicer. For example I could add a
bevel box. I found the function DrawBevelBox(), but this is also
just a drawing function, so have the same problem again, How do I prevent my
bevel box from being damaged if another window is moved over
my window?

Programming the amiga would be much simpler I we had much more books or
examples, the RKRMs or the autodocs are a good reference
if now what you are looking for, but they are insufficient if you need an
entry in the world of Amiga-specific programming :-(

Kind regards Alexander Fritsch